// @ts-ignore
/* eslint-disable */
import { OpenApi as request } from "@/utils/request";

/** 角色新增 POST /platform/role/add */
export async function add7(
  body: API.RoleCreateDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/platform/role/add`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 角色所有 GET /platform/role/all */
export async function all3(options?: { [key: string]: any }) {
  return request<API.BaseResponseListRoleVo>(`/barter-user/platform/role/all`, {
    method: "GET",
    ...(options || {}),
  });
}

/** 角色删除 POST /platform/role/del */
export async function del4(body: API.IdDto, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>(`/barter-user/platform/role/del`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 角色详情 GET /platform/role/detail */
export async function detail7(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.detail7Params,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseRoleVo>(`/barter-user/platform/role/detail`, {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 角色编辑 POST /platform/role/edit */
export async function edit8(
  body: API.RoleUpdateDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/platform/role/edit`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 角色列表 GET /platform/role/list */
export async function listPage5(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listPage5Params,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageRespRoleVo>(
    `/barter-user/platform/role/list`,
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
